<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="PersonaEditDlg" widgetVar="PersonaEditDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.EditPersonaTitle}">
            <h:form id="PersonaEditForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{personaController.selected != null}">
                        <p:outputLabel value="#{bundle.EditPersonaLabel_idpersona}" for="idpersona" />
                        <p:inputText id="idpersona" value="#{personaController.selected.idpersona}" title="#{bundle.EditPersonaTitle_idpersona}" required="true" requiredMessage="#{bundle.EditPersonaRequiredMessage_idpersona}"/>
                        <p:outputLabel value="#{bundle.EditPersonaLabel_nombres}" for="nombres" />
                        <p:inputText id="nombres" value="#{personaController.selected.nombres}" title="#{bundle.EditPersonaTitle_nombres}" />
                        <p:outputLabel value="#{bundle.EditPersonaLabel_apellidos}" for="apellidos" />
                        <p:inputText id="apellidos" value="#{personaController.selected.apellidos}" title="#{bundle.EditPersonaTitle_apellidos}" />
                        <p:outputLabel value="#{bundle.EditPersonaLabel_email}" for="email" />
                        <p:inputText id="email" value="#{personaController.selected.email}" title="#{bundle.EditPersonaTitle_email}" />
                        <p:outputLabel value="#{bundle.EditPersonaLabel_telefono}" for="telefono" />
                        <p:inputText id="telefono" value="#{personaController.selected.telefono}" title="#{bundle.EditPersonaTitle_telefono}" />
                    </p:panelGrid>
                    <p:commandButton actionListener="#{personaController.update}" value="#{bundle.Save}" update="display,:PersonaListForm:datalist" oncomplete="handleSubmit(args, 'PersonaEditDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="PersonaEditDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
